cmake_minimum_required(VERSION 3.5)

project(opc62541_dome1 LANGUAGES C)

if (CMAKE_STAGING_PREFIX)
  include_directories(${CMAKE_STAGING_PREFIX}/include)
  link_directories(${CMAKE_STAGING_PREFIX}/lib)
else()
  include_directories(/usr/local/include)
  link_directories(/usr/local/lib)
endif()

add_executable(opc62541_dome1 main.c)

target_link_libraries(opc62541_dome1 dl open62541 -latomic)

include(GNUInstallDirs)
install(TARGETS opc62541_dome1
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
